package com.itheima.rabittmq;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import java.util.function.Consumer;
@Component
public class RabbitMQBean {
    @Bean
    public Consumer<String> handleMessage() {
        return message -> {
            // 处理接收到的消息
            System.out.println("Received message: " + message);
        };
    }
}